<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>VDS Manager</title>
  </head>
  <body>
  	<div align="center" style="font-family: 黑体;">
  		<h2>用户详细信息</h2>
  		<table style="text-align: center;">
  			<tr>
  				<th width="16px">ID</th>
  				<th width="128px">用户名</th>
  				<th width="128px">密码</th>
  				<th width="96px">是否启用</th>
  				<th width="128px">创建者</th>
  				<th width="160px">创建时间</th>
  				<th width="160px">角色</th>
  				<th width="60px">操作</th>
  			</tr>
  			<s:iterator id="user" value="#request.users">
  				<tr>
  					<td><s:property value="#user.getId()" /></td>
  					<td><s:property value="#user.getUser()" /></td>
  					<td>&lt;加密数据&gt;</td>
  					<s:if test="#user.getIsEnabled()">
  						<td>是</td>
  					</s:if>
  					<s:else>
  						<td>否</td>
  					</s:else>
  					<td><s:property value="#user.getCreatedBy().getUser()" /></td>
  					<td><s:property value="#user.getCreatedTime()" /></td>
  					<td>
  						<s:iterator id="role" value="#user.getRoles()">
  							<s:if test="#role.getRoleName()=='ROLE_ADMINISTRATOR'">
  								[管理员]
  							</s:if>
  							<s:if test="#role.getRoleName()=='ROLE_USER'">
  								[用户]
  							</s:if>
  						</s:iterator>
  					</td>
  					<s:set name="lastName"><%= session.getAttribute("SPRING_SECURITY_LAST_USERNAME").toString() %></s:set>
  					<s:if test="#user.getUser()==#lastName">
  						<td>&nbsp;</td>
  					</s:if>
  					<s:else>
  						<td>
  							<a href="<%=path %>/management/system/removeUser.action?id=<s:property value='#user.getId()' />">删除</a>
  						</td>
  					</s:else>
  				</tr>
  			</s:iterator>
  		</table>
  	</div>
  </body>
</html>
